<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form method="post" action="index.php?p=test&c=test&a=doreg">
        <table>
            <tr>
                <td><li>用户名：</li></td><td><input type="text" name="username" id="username"><span id="msg"></span></td>
            </tr>
            <tr>
                <td><li>密&nbsp;&nbsp;&nbsp;码：</li></td><td><input type="password" name="password"></td>
            </tr>
            <tr>
                <td><input type="submit" value="注册"/></td>
            </tr>
        </table>
        <iframe src="" frameborder="0" width="0" height="0" id = "iframe"></iframe>
    </form>

    <script type="text/javascript">
        var username = document.getElementById("username");
        var iframe = document.getElementById("iframe");
        username.onblur = function () {
            iframe.src = "index.php?p=test&c=test&a=checkUsername&username="+username.value;
        }
    </script>
</body>
</html>